<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>
<?php $this->load->view('admin/header.html')?>
<script type="text/javascript" src="<?php echo base_url()?>common/js/additional-methods.js"></script>
<script type="text/javascript" src="<?php echo base_url()?>common/js/validateForm.js"></script>
<script type="text/javascript" src="<?php echo base_url()?>common/js/MyJs.js"></script>
<script type="text/javascript" src="<?php echo base_url()?>common/laydate/laydate.js"></script>
<script type="text/javascript">

    function Success(data) {
        $.Success(data);
    }
    UE.getEditor('goods_desc');
    function goods_enable(goodsid)
    {
        var url = "/admin/recovery/enable_goods/" + goodsid + "?returnurl=<?php echo $return?>";
        layer.confirm("确定要启用改商品？", function () {
            $.post(url, null, function (data) {
                var jsonData = $.parseJSON(data);
                if (jsonData.Statu == 'ok') {
                    Success(jsonData)
                }
                else {
                    Success(jsonData)
                }
            })
        }, function () {
            layer.msg('取消删除', { icon: 0 });
        })
    }

</script>
<div id="dcMain">
    <!-- 当前位置 -->
    <div id="urHere">
        DouPHP 管理中心
    </div>
    <div id="manager" class="mainBox" style="height:auto!important;height:550px;min-height:550px;">
        <h3>商品查看</h3>
            <table width="100%" border="0" cellpadding="8" cellspacing="0" class="tableBasic">
                <tr>
                    <td width="100" align="right">商品序号</td>
                    <td>
                        <input disabled="disabled" type="text" name="title" id="title" size="80" class="inpMain " value="<?php echo $goodsModel->goods_id?>" />
                    </td>
                </tr>
                <tr>
                    <td width="100" align="right">商品名称</td>
                    <td>
                        <input  disabled="disabled" type="text" name="title" id="title" size="80" class="inpMain " value="<?php echo $goodsModel->title?>" />
                    </td>
                </tr>
                <tr>
                    <td width="100" align="right">商品关键字</td>
                    <td>
                        <textarea  disabled="disabled" class="inpMain" id="seo_keyword" name="seo_keyword" style="resize:none;height:100px;width:600px;"><?php echo $goodsModel->seo_keyword?></textarea>
                    </td>
                </tr>
                <tr>
                    <td align="right">商品描述</td>
                    <td>
                        <textarea  disabled="disabled" class="inpMain" id="seo_description" name="seo_description" style="resize:none;height:100px;width:600px;"><?php echo $goodsModel->seo_description?></textarea>
                    </td>
                </tr>
                <tr>
                    <td width="100" align="right">商品图片</td>
                    <td style="position:relative;">
                        <img id="img_tag" src="<?php echo !empty($goodsModel)?$goodsModel->imgurl:""?>" onerror="this.src='<?php echo base_url('common')?>/images/nopic.png'" style="height:100px;width:100px;cursor:pointer;float:left;" />
                    </td>
                </tr>
                <tr>
                    <td width="100" align="right">市场价格</td>
                    <td>
                        <input  disabled="disabled" type="text" name="market_price" id="market_price" size="30" class="inpMain " value="<?php echo $goodsModel->market_price?>" />
                    </td>
                </tr>
                <tr>
                    <td width="100" align="right">促销价格</td>
                    <td>
                        <input  disabled="disabled" type="text" name="shop_price" id="shop_price" size="30" class="inpMain " value="<?php echo $goodsModel->shop_price?>" />
                    </td>
                </tr>
                <tr>
                    <td width="100" align="right">材质选择</td>
                    <td>
                        <?php $index=0;?>
                        <?php foreach($materialList as $materiaItem):?>
                        <label for="mt_<?php echo $index;?>"><?php echo $materiaItem->title?></label> <input  disabled="disabled" type="radio"  value="<?php echo $materiaItem->good_material_id?>" id="mt_<?php echo $index;?>" name="good_material_id" <?php echo $materiaItem->good_material_id==$goodsModel->good_material_id?'checked="checked"':''?> />&nbsp;&nbsp;
                        <?php $index++;?>
                        <?php endforeach;?>
                       
                    </td>
                </tr>
                <tr>
                    <td width="100" align="right">样式选择</td>
                    <td>
                        <?php $index=0;?>
                        <?php foreach($stylelList as $styleItem):?>
                        <label for="st_<?php echo $index;?>"><?php echo $styleItem->title?></label> <input  disabled="disabled" type="radio" value="<?php echo $styleItem->goods_style_id?>" id="st_<?php echo $index;?>" name="goods_style_id" <?php echo $styleItem->goods_style_id==$goodsModel->goods_style_id?'checked="checked"':''?> />&nbsp;&nbsp;
                        <?php $index++;?>
                        <?php endforeach;?>

                    </td>
                </tr>
                <tr>
                    <td width="100" align="right">商品描述</td>
                    <td>
                        <textarea id="goods_desc" name="goods_desc" style="height:500px;width:965px;">
                            <?php echo $goodsModel->goods_desc?>
                        </textarea>
                    </td>
                </tr>
                <tr>
                    <td width="100" align="right">是否上架</td>
                    <td>
                        <label for="sale_on">上架</label> <input  disabled="disabled" type="radio" value="1" id="sale_on" name="is_on_sale" <?php echo $goodsModel->is_on_sale==1?'checked="checked"':''?>  />
                        <label for="sale_off">下架</label><input  disabled="disabled" type="radio" value="0" id="sale_off" name="is_on_sale" <?php echo $goodsModel->is_on_sale==0?'checked="checked"':''?> />
                    </td>
                </tr>
                <tr>
                    <td width="100" align="right">是否最新</td>
                    <td>
                        <label for="news_on">是</label> <input  disabled="disabled" type="radio" value="1" id="news_on" name="is_new" <?php echo $goodsModel->is_new==1?'checked="checked"':''?> />
                        <label for="news_off">否</label><input  disabled="disabled" type="radio" value="0" id="news_off" name="is_new" <?php echo $goodsModel->is_new==0?'checked="checked"':''?> />
                    </td>
                </tr>
                <tr>
                    <td width="100" align="right">是否热销</td>
                    <td>
                        <label for="hot_on">是</label> <input  disabled="disabled" type="radio" value="1" id="hot_on" name="is_hot"  <?php echo $goodsModel->is_hot==1?'checked="checked"':''?> />
                        <label for="hot_off">否</label><input  disabled="disabled" type="radio" value="0" id="hot_off" name="is_hot" <?php echo $goodsModel->is_hot==0?'checked="checked"':''?> />
                    </td>
                </tr>
                <tr>
                    <td width="100" align="right">发布日期</td>
                    <td>
                        <input  disabled="disabled" type="text" name="addtime" id="addtime" size="20" class="inpMain " value="<?php echo date('Y-m-d',strtotime($goodsModel->addtime)) ?>" readonly="readonly"/>
                    </td>
                </tr>
                <tr>
                    <td width="100" align="right">权重</td>
                    <td>
                        <input disabled="disabled" type="text" name="weight" id="weight" size="40" class="inpMain " value="<?php echo $goodsModel->weight;?>" />
                    </td>
                </tr>
                <tr>
                    <td></td>
                    <td>
                        <a class="btn" href="JavaScript:goods_enable(<?php echo $goodsModel->goods_id?>)">启用</a>
                        <input type="button" class="btn" value="返回" onclick="GoBack()" />
                    </td>
                </tr>
            </table>
        <script>
            laydate({
                elem: '#addtime',
                event: 'focus' 
            });
        </script>
    </div>
</div>
